Dynamic instrumentation of software (e.g., a computer program), is used to collect data (e.g., performance data) with respect to the software without recompiling or rebuilding the software. The collected data, generally may be used to solve deep-rooted problems such as deadlocks, resource contention, memory leaks, etc. In typical computer based systems implementing a kernel mode and a user mode, it is useful to collect data from the kernel mode as well as from the user mode with low overhead. Accordingly, there is a need for dynamic instrumentation solutions that achieve data collection involving both the kernel mode and the user mode with low overhead.